#!/usr/bin/env python3
# -*- coding: utf-8 -*-

class Dict(dict):
    '''
    >>> d = Dict()
    >>> d['x'] = 100
    >>> d.x
    100
    '''
    def __init__(self, **kw):
        super(Dict,self).__init__(**kw)
    # def __getattr__(self,key):
    #     try:
    #         return self[key]
    #     except KeyError:
    #         raise AttributeError(r"'Dict' object has no attribute '%s' " % key)
    def __setattr__(self,key,value):
        self[key] = value
if __name__ == '__main__':
    import doctest
    doctest.testmod()
    print('-----')
